<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:body>
	
	<h:form>
		<div>
			<h:commandButton value="Add new patient" action="addNewPatient"></h:commandButton>
		</div>
	</h:form>

	<h:form prependId="false">

		<p:dataTable id="dataTable" var="pers" value="#{tableBean.persons}"
			paginator="true" rows="10"
			paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
			rowsPerPageTemplate="5,10,15">

			<p:column filterBy="#{pers.lastName}">
				<f:facet name="header">
					<h:outputText value="Last Name" />
				</f:facet>
				<h:outputText value="#{pers.lastName}" />
			</p:column>

			<p:column filterBy="#{pers.firstName}">
				<f:facet name="header">
					<h:outputText value="First Name" />
				</f:facet>
				<h:outputText value="#{pers.firstName}" />
			</p:column>

			<p:column filterBy="#{pers.middleName}">
				<f:facet name="header">
					<h:outputText value="Middle Name" />
				</f:facet>
				<h:outputText value="#{pers.middleName}" />
			</p:column>

			<p:column filterBy="#{pers.age}">
				<f:facet name="header">
					<h:outputText value="Age" />
				</f:facet>
				<h:outputText value="#{pers.age}" />
			</p:column>
			
			<p:column filterBy="#{pers.city}">
				<f:facet name="header">
					<h:outputText value="City" />
				</f:facet>
				<h:outputText value="#{pers.city}" />
			</p:column>
		</p:dataTable>

	</h:form>
</h:body>
</html>